<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/
//view
Route::get('/', 'OrdercustomerController@getIndex');	

Route::get('/cekorder', 'OrdercustomerController@getCekorder');	
Route::post('/cekorder', 'OrdercustomerController@postCekorder');	

Route::get('/status', 'OrdercustomerController@getStatus');	

Route::get('/agenregister', 'OrdercustomerController@getAgenreg');	
Route::post('/agenreg', 'OrdercustomerController@postAgenreg');	

//order brochure
Route::get('order/orderbrosur', 'OrdercustomerController@getOrderbrosur');	
Route::post('order/orderbrosur', 'OrdercustomerController@postOrderbrosur');

//order id card
Route::get('order/orderidcard', 'OrdercustomerController@getOrderidcard');	
Route::post('order/orderidcard', 'OrdercustomerController@postOrderidcard');	

//order packaging
Route::get('order/orderpackaging', 'OrdercustomerController@getOrderpackaging');	
Route::post('order/orderpackaging', 'OrdercustomerController@postOrderpackaging');	

//order tshirt
Route::get('order/ordertshirt', 'OrdercustomerController@getOrdertshirt');	
Route::post('order/ordertshirt', 'OrdercustomerController@postOrdertshirt');	

//order nota
Route::get('order/ordernota', 'OrdercustomerController@getOrdernota');	
Route::post('order/ordernota', 'OrdercustomerController@postOrdernota');

//order brosur
Route::get('order/orderbrosur', 'OrdercustomerController@getOrderbrosur');	
Route::post('order/orderbrosur', 'OrdercustomerController@postOrderbrosur');

//add
Route::get('order/fiturtambahan', 'OrdercustomerController@getFiturtambahan');	
Route::post('order/fiturtambahan', 'OrdercustomerController@postFiturtambahan');	
Route::get('order/datapemesan', 'OrdercustomerController@getDatapemesan');	
Route::post('order/datapemesan', 'OrdercustomerController@postDatapemesan');	
Route::get('order/orderresult', 'OrdercustomerController@getOrderresult');	
Route::get('order/orderback', 'OrdercustomerController@getOrderback');	
Route::get('order/orderbackend', 'OrdercustomerController@getOrderbackend');	

//cek price
	Route::post('/pesanproduk/get_brosur_price', 'PesanprodukController@get_brosur_price');
	Route::post('/pesanproduk/get_idcard_price', 'PesanprodukController@get_idcard_price');
	Route::post('/pesanproduk/get_nota_price', 'PesanprodukController@get_nota_price');
	Route::post('/pesanproduk/get_packaging_price', 'PesanprodukController@get_packaging_price');
	Route::post('/pesanproduk/get_tshirt_price', 'PesanprodukController@get_tshirt_price');



	
Route::get('order/print/{id}', 'PrintController@getPrint');	
// Route::post('order/print/{id}', 'PrintController@getPrint');	


//admin 
Route::get('/admin', 'AdminController@getLogin');	
Route::post('/admin/login', 'AdminController@postLogin');	

//showing redirect error page
// App::error(function($exception, $code) { 
// 	switch ($code) { case 403: return Response::view('errors.403', array(), 403); 
// 	case 404: return Response::view('error.404'); 
// 	case 500: return Response::view('error.500'); 
// 	default: return Response::view('errors.default', array(), $code); } 
// });


Route::group(array('before' => 'admin'), function(){

	Route::group(array('before' => 'su'), function(){
		Route::get('/admin/accountlist', 'AdminController@getAccountlist');	
		Route::post('/admin/tambahadmin', 'AdminController@postTambahadmin');	
		Route::post('/admin/editadmin/{id}', 'AdminController@postEditadmin');	
		Route::get('/admin/deleteadmin/{id}', 'AdminController@postDeleteadmin');	

	

	//master
	//add features
	Route::get('/master/addfeatures', 'MasterController@getAddfeatures');	
	Route::post('/master/addfeature', 'MasterController@postAddfeatures');	
	Route::get('/master/addfeature', 'MasterController@postAddfeatures');	
	Route::post('/master/addfeatures/addaddfeatures', 'MasterController@postAddaddfeatures');	
	Route::post('/master/addfeatures/editaddfeatures/{id}', 'MasterController@postEditaddfeatures');
	Route::post('/master/addfeatures/deleteaddfeatures', 'MasterController@postDeleteaddfeatures');	
	//paper
	Route::get('/master/papers', 'MasterController@getPapers');	
	Route::post('/master/paper', 'MasterController@postPapers');	
	Route::get('/master/paper', 'MasterController@postPapers');	
	Route::post('/master/papers/addpapers', 'MasterController@postAddpapers');	
	Route::post('/master/papers/editpapers/{id}', 'MasterController@postEditpapers');
	Route::post('/master/papers/deletepapers', 'MasterController@postDeletepapers');	
	//packaging
	Route::get('/packaging', 'PackagingController@getPackaging');	
	Route::post('/packagings', 'PackagingController@postPackaging');	
	Route::get('/packagings', 'PackagingController@postPackaging');	
	Route::post('/packaging/addpackaging', 'PackagingController@postAddpackaging');	
	Route::post('/packaging/editpackaging/{id}', 'PackagingController@postEditpackaging');	
	Route::post('/packaging/deletepackaging', 'PackagingController@postDeletepackaging');	
	//brosur
	Route::get('/brosur', 'BrosurController@getBrosur');	
	Route::post('/brosurs', 'BrosurController@postBrosur');	
	Route::get('/brosurs', 'BrosurController@postBrosur');	
	Route::post('/brosur/addbrosur', 'BrosurController@postAddbrosur');
	Route::post('/brosur/addkopsurat', 'BrosurController@postAddkopsurat');
	Route::post('/brosur/addflayer', 'BrosurController@postAddflayer');
	Route::post('/brosur/addenvelope', 'BrosurController@postAddenvelope');
	Route::post('/brosur/editbrosur/{id}', 'BrosurController@postEditbrosur');
	Route::post('/brosur/editletterhead/{id}', 'BrosurController@postEditletterhead');
	Route::post('/brosur/editflayer/{id}', 'BrosurController@postEditflayer');
	Route::post('/brosur/editenvelope/{id}', 'BrosurController@postEditenvelope');
	Route::post('/brosur/deletebrosur', 'BrosurController@postDeletebrosur');
	//nota
	Route::get('/nota', 'NotaController@getNota');	
	Route::post('/notas', 'NotaController@postNota');	
	Route::get('/notas', 'NotaController@postNota');	
	Route::post('/nota/addnota', 'NotaController@postAddnota');	
	Route::post('/nota/editnota/{id}', 'NotaController@postEditnota');	
	Route::post('/nota/deletenota', 'NotaController@postDeletenota');	
	//tshirt
	Route::get('/tshirt', 'TshirtController@getTshirt');	
	Route::post('/tshirts', 'TshirtController@postTshirt');	
	Route::get('/tshirts', 'TshirtController@postTshirt');	
	Route::post('/tshirt/addtshirt', 'TshirtController@postAddtshirt');	
	Route::post('/tshirt/edittshirt/{id}', 'TshirtController@postEdittshirt');	
	Route::post('/tshirt/deletetshirt', 'TshirtController@postDeletetshirt');	

	Route::get('/tshirt/detail/{id}', 'TshirtController@getTshirtdetail');	
	Route::post('/tshirt/detail/{id}', 'TshirtController@getTshirtdetail');	
	Route::post('/tshirt/searchtshirtdetail', 'TshirtController@postTshirtdetail');	
	Route::get('/tshirt/searchtshirtdetail', 'TshirtController@postTshirtdetail');	
	Route::post('/tshirt/addtshirtdetail/{id}', 'TshirtController@postAddtshirtdetail');	
	Route::post('/tshirt/edittshirtdetail/{id}', 'TshirtController@postEdittshirtdetail');	
	Route::post('/tshirt/deletetshirtdetail', 'TshirtController@postDeletetshirtdetail');	


	//id card
	Route::get('/idcard/idcardtype', 'IdcardController@getIdcardtype');	
	Route::post('/idcard/idcardtypes', 'IdcardController@postIdcardtype');	
	Route::get('/idcard/idcardtypes', 'IdcardController@postIdcardtype');	
	Route::post('/idcard/idcardtype/addidcardtype', 'IdcardController@postAddidcardtype');	
	Route::post('/idcard/idcardtype/editidcardtype/{id}', 'IdcardController@postEditidcardtype');	
	Route::post('/idcard/idcardtype/deleteidcardtype', 'IdcardController@postDeleteidcardtype');	

	Route::get('/idcard/idcardquality', 'IdcardController@getIdcardquality');	
	Route::post('/idcard/idcardqualitys', 'IdcardController@postIdcardquality');	
	Route::get('/idcard/idcardqualitys', 'IdcardController@postIdcardquality');	
	Route::post('/idcard/idcardquality/addidcardquality', 'IdcardController@postAddidcardquality');	
	Route::post('/idcard/idcardquality/editidcardquality/{id}', 'IdcardController@postEditidcardquality');	
	Route::post('/idcard/idcardquality/deleteidcardquality', 'IdcardController@postDeleteidcardquality');	


	//bonus config
	Route::get('/bonus', 'MasterController@getAgenbonus');
	Route::post('bonus/edit/{id}', 'MasterController@postAgenbonus');

	});


    Route::get('/admin/logout', 'AdminController@getLogout');	
	Route::get('/admin/profile', 'AdminController@getProfile');	
	Route::post('/admin/editprofil/{id}', 'AdminController@postEditprofil');	
	Route::get('/dashbord', 'AdminController@getAdminhome');	

	//incoming order
	Route::get('/order/incomingorder', 'IncomingorderController@getIncomingorder');
	Route::post('/order/incomingorder', 'IncomingorderController@getIncomingorder');
	Route::post('/order/incomingorders', 'IncomingorderController@postIncomingorder');
	Route::get('/order/incomingorders', 'IncomingorderController@postIncomingorder');
	Route::post('/order/incomingorder/approve', 'IncomingorderController@postIncomingorderapprove');
	Route::get('/order/incomingorder/approve/{id}', 'IncomingorderController@getIncomingorderapproveid');
	Route::post('/order/incomingorder/cancel', 'IncomingorderController@postIncomingordercancel');
	Route::get('/order/incomingorder/cancel/{id}', 'IncomingorderController@getIncomingordercancelid');
	Route::get('/order/incomingorder/detail/{id}', 'IncomingorderController@getDetailincomingorder');
	Route::post('/order/incomingorder/detail/{id}', 'IncomingorderController@getDetailincomingorder');
	Route::post('/order/incomingorder/setdealprice/{id}', 'IncomingorderController@postSetdealprice');
	Route::post('/order/incomingorder/changedesain/{id}', 'IncomingorderController@postDetailincomingorderchangedesain');




	Route::get('/order/approvingorder', 'ApprovingorderController@getApprovingorder');
	Route::post('/order/approvingorders', 'ApprovingorderController@postApprovingorder');
	Route::get('/order/approvingorders', 'ApprovingorderController@postApprovingorder');
	Route::post('/order/approvingorder/process', 'ApprovingorderController@postApprovingorderprocess');
	Route::get('/order/approvingorder/process/{id}', 'ApprovingorderController@getApprovingorderprocessid');
	Route::post('/order/approvingorder/cancel', 'ApprovingorderController@postApprovingordercancel');
	Route::get('/order/approvingorder/cancel/{id}', 'ApprovingorderController@getApprovingordercancelid');
	Route::get('/order/approvingorder/detail/{id}', 'ApprovingorderController@getDetailapprovingorder');
	Route::post('/order/approvingorder/detail/{id}', 'ApprovingorderController@getDetailapprovingorder');
	Route::post('/order/approvingorder/setpayment/{id}', 'ApprovingorderController@postSetpayment');



	Route::get('/order/onprocessorder', 'OnprocessorderController@getOnprocessorder');
	Route::post('/order/onprocessorders', 'OnprocessorderController@postOnprocessorder');
	Route::get('/order/onprocessorders', 'OnprocessorderController@postOnprocessorder');
	Route::post('/order/onprocessorder/finished', 'OnprocessorderController@postOnprocessorderfinished');
	Route::get('/order/onprocessorder/finished/{id}', 'OnprocessorderController@getOnprocessorderfinishedid');
	Route::post('/order/onprocessorder/cancel', 'OnprocessorderController@postOnprocessordercancel');
	Route::get('/order/onprocessorder/cancel/{id}', 'OnprocessorderController@getOnprocessordercancelid');
	Route::get('/order/onprocessorder/detail/{id}', 'OnprocessorderController@getDetailonprocessorder');
	Route::post('/order/onprocessorder/detail/{id}', 'OnprocessorderController@getDetailonprocessorder');
	Route::post('/order/onprocessorder/setduedate/{id}', 'OnprocessorderController@postSetduedate');
	Route::get('/order/onprocessorder/comment/{id}', 'OnprocessorderController@getComment');
	Route::post('/order/onprocessorder/comment/{id}', 'OnprocessorderController@getComment');
	Route::post('/order/onprocessorder/comment/addcomment/{id}', 'OnprocessorderController@postAddcomment');
	Route::post('/order/onprocessorder/comment/deletecomment/{id}', 'OnprocessorderController@postDeletecomment');
	Route::get('/order/onprocessorder/progress/{id}', 'OnprocessorderController@getProgress');
	Route::post('/order/onprocessorder/progress/{id}', 'OnprocessorderController@getProgress');
	Route::post('/order/onprocessorder/progress/addprogress/{id}', 'OnprocessorderController@postAddprogress');
	Route::post('/order/onprocessorder/progress/deleteprogress/{id}', 'OnprocessorderController@postDeleteprogress');



	Route::get('/order/finishedorder', 'FinishedorderController@getFinishedorder');
	Route::post('/order/finishedorders', 'FinishedorderController@postFinishedorder');
	Route::get('/order/finishedorders', 'FinishedorderController@postFinishedorder');
	Route::post('/order/finishedorder/delivered', 'FinishedorderController@postFinishedorderdelivered');
	Route::post('/order/finishedorder/cancel', 'FinishedorderController@postFinishedordercancel');
	Route::post('/order/finishedorder/setpayment/{id}', 'FinishedorderController@postFinishedordersetpayment');

	Route::get('/order/deliveredorder', 'DeliveredorderController@getDeliveredorder');
	Route::post('/order/deliveredorders', 'DeliveredorderController@postDeliveredorder');
	Route::get('/order/deliveredorders', 'DeliveredorderController@postDeliveredorder');


	Route::get('/order/canceledorder', 'CanceledorderController@getCanceledorder');
	Route::post('/order/canceledorders', 'CanceledorderController@postCanceledorder');
	Route::get('/order/canceledorders', 'CanceledorderController@postCanceledorder');
	Route::post('/order/canceledorder/cancel', 'CanceledorderController@postCanceledordercancel');


	//order by admin
	Route::get('/pesanproduk', 'PesanprodukController@getPesanproduk');

	Route::post('/pesanproduk/pesanbrosur', 'PesanprodukController@postPesanbrosur');
	Route::post('/pesanproduk/pesanbidard', 'PesanprodukController@postPesanidard');
	Route::post('/pesanproduk/pesantshirt', 'PesanprodukController@postPesantshirt');
	Route::post('/pesanproduk/pesanpackaging', 'PesanprodukController@postPesanpackaging');
	Route::post('/pesanproduk/pesannota', 'PesanprodukController@postPesannota');


	//dashboard
	Route::get('/dashboard', 'AdminController@getDashboard');

	//agen
	Route::get('/agen', 'AgenController@getAgen');
	Route::post('/agens', 'AgenController@postAgen');
	Route::get('/agens', 'AgenController@postAgen');
	Route::post('/agen/editpassword/{id}', 'AgenController@postEditpasswordagen');
	Route::post('/agen/editprofile/{id}', 'AgenController@postEditprofileagen');
	Route::post('/agen/aktif', 'AgenController@postAktifagen');
	Route::post('/agen/nonaktif', 'AgenController@postNonaktifagen');

	Route::get('/agen/bonus', 'AgenController@getAgenbonus');
	Route::post('/agen/bonus/edit/{id}', 'AgenController@postAgenbonus');

	//bonus agen
	Route::post('/agen/bonus/{id}', 'AgenController@getAgenbonus');

	// Route::post('/agen/login/{id}', 'AgenController@getLoginagen');
	Route::get('/agenlogin/{id}', 'AgenController@getAgenlogin');
	

                
                    //---------report----------------//
	
        //order
        Route::get('/report/order', 'ReportController@getOrder');
	Route::post('/report/ordersearch', 'ReportController@postOrder');
	Route::get('/report/ordersearch', 'ReportController@postOrder');
	Route::post('/report/orderperbulan', 'ReportController@postOrderbulan');
	Route::get('/report/orderperbulan', 'ReportController@postOrderbulan');
	Route::get('/report/orderexportxls', 'ExcelController@getExcelorder');	

        //status
	Route::get('/report/status', 'ReportController@getStatus');
	Route::post('/report/statussearch', 'ReportController@postStatus');
	Route::get('/report/statussearch', 'ReportController@postStatus');
	Route::post('/report/statusperbulan', 'ReportController@postStatusbulan');
	Route::get('/report/statusperbulan', 'ReportController@postStatusbulan');
	Route::get('/report/statusexportxls', 'ExcelController@getExcelstatus');	

        //produk
	Route::get('/report/produk', 'ReportController@getProduk');
	Route::post('/report/produksearch', 'ReportController@postProduk');
	Route::get('/report/produksearch', 'ReportController@postProduk');
	Route::post('/report/produkperbulan', 'ReportController@postProdukbulan');
	Route::get('/report/produkperbulan', 'ReportController@postProdukbulan');
	Route::get('/report/produkexportxls', 'ExcelController@getExcelproduk');
	
        
        //bonus
        Route::get('/report/bonus', 'ReportController@getBonus');
        Route::get('/report/bonussearch', 'ReportController@postBonus');
        Route::post('/report/bonussearch', 'ReportController@postBonus');
        Route::post('/report/bonusperbulan', 'ReportController@postBonusbulan');
        Route::get('/report/bonusperbulan', 'ReportController@postBonusbulan');
		Route::get('/report/bonusexportxls', 'ExcelController@getExcelbonus');
        
        //agen
	Route::get('/report/agen', 'ReportController@getAgen');
	Route::post('/report/agensearch', 'ReportController@postAgen');
	Route::get('/report/agensearch', 'ReportController@postAgen');
	Route::post('/report/agenperbulan', 'ReportController@postAgenbulan');	
	Route::get('/report/agenperbulan', 'ReportController@postAgenbulan');	
	Route::get('/report/agenexportxls', 'ExcelController@getExcelagen');	

	//pesan produk
	Route::post('/pesanbrosur', 'PesanprodukController@postPesanbrosur');
	Route::post('/pesanidcard', 'PesanprodukController@postPesanidcard');
	Route::post('/pesanpackaging', 'PesanprodukController@postPesanpackaging');
	Route::post('/pesantshirt', 'PesanprodukController@postPesantshirt');
	Route::post('/pesannota', 'PesanprodukController@postPesannota');

	Route::post('/pesanproduk/pesanbrosur', 'PesanprodukController@postBrosur');
	Route::post('/pesanproduk/pesanidcard', 'PesanprodukController@postIdcard');
	Route::post('/pesanproduk/pesanpackaging', 'PesanprodukController@postPackaging');
	Route::post('/pesanproduk/pesantshirt', 'PesanprodukController@postTshirt');
	Route::post('/pesanproduk/pesannota', 'PesanprodukController@postNota');


	});



	Route::post('/login', 'VirtualofficeController@postLogin');
	
Route::group(array('before' => 'user'), function(){

	//Virtual office
	Route::get('/virtualoffice', 'VirtualofficeController@getBeranda');
	Route::get('/virtualoffice/logout', 'VirtualofficeController@getLogout');
	Route::get('/virtualoffice/daftarharga', 'VirtualofficeController@getDaftarharga');
	Route::post('/virtualoffice/daftarhargaproduk', 'VirtualofficeController@postDaftarharga');
	Route::get('/virtualoffice/daftarhargaproduk', 'VirtualofficeController@postDaftarharga');
	Route::get('/virtualoffice/produk', 'VirtualofficeController@getProduk');
	Route::get('/virtualoffice/agen', 'VirtualofficeController@getAgen');
	Route::post('/virtualoffice/agens', 'VirtualofficeController@postAgen');
	Route::get('/virtualoffice/agens', 'VirtualofficeController@postAgen');
	Route::get('/virtualoffice/daftarpesanan', 'VirtualofficeController@getDaftarpesanan');
	Route::post('/virtualoffice/daftarpesananproduk', 'VirtualofficeController@postDaftarpesanan');
	Route::get('/virtualoffice/daftarpesananproduk', 'VirtualofficeController@postDaftarpesanan');
	Route::get('/virtualoffice/komisi', 'VirtualofficeController@getKomisi');
	Route::get('/virtualoffice/profil', 'VirtualofficeController@getProfil');
	Route::post('/virtualoffice/tambahagen', 'VirtualofficeController@postTambahagen');


	Route::post('/virtualoffice/editprofile/{id}', 'VirtualofficeController@postEditprofile');
	Route::post('/virtualoffice/editpassword/{id}', 'VirtualofficeController@postEditpassword');
	Route::post('/virtualoffice/editgambar/{id}', 'VirtualofficeController@postEditgambar');

	Route::get('/print/packagingprice', 'PrintController@getPackagingprice');	
	Route::get('/print/idcardprice', 'PrintController@getIdcardprice');	
	Route::get('/print/brochureprice', 'PrintController@getBrochureprice');	
	Route::get('/print/notaprice', 'PrintController@getNotaprice');	
	Route::get('/print/tshirtprice', 'PrintController@getTshirtprice');	


	Route::post('/virtualoffice/pesanbrosur', 'VirtualofficeController@postBrosur');
	Route::post('/virtualoffice/pesanidcard', 'VirtualofficeController@postIdcard');
	Route::post('/virtualoffice/pesanpackaging', 'VirtualofficeController@postPackaging');
	Route::post('/virtualoffice/pesantshirt', 'VirtualofficeController@postTshirt');
	Route::post('/virtualoffice/pesannota', 'VirtualofficeController@postNota');
	});



